package za.org.jcicada.cfgmngr.impl;

import java.util.List;
import java.util.Set;

import za.org.jcicada.cfgmngr.IPhysicalClient;
import za.org.jcicada.genss.PhysicalURN;
import za.org.jcicada.genss.SystemURN;
import za.org.jcicada.genss.messages.Result;
import za.org.jcicada.genss.sensor.SensorURN;

public class StubPhysicalClient implements IPhysicalClient {

	public boolean disconnected = false;
	public Result result;
	public PhysicalURN parentURN;
	public List<PhysicalURN> childrenURNs;
	public String view;
	public PhysicalURN physicalURN;
	public SensorURN sensorURN;
	public int number;
	public int informViewSensorCount = 0;
	public Set<SystemURN> systemURNs;
	public Event event;
	
	public void informDisconnect() {
		disconnected = true;
	}

	public void replyGetChildren(Result result, PhysicalURN parentURN, List<PhysicalURN> childrenURNs) {
		this.result = result;
		this.parentURN = parentURN;
		this.childrenURNs = childrenURNs;
	}

	public void informViewSensor(String view, PhysicalURN physicalURN, SensorURN sensorURN) {
		informViewSensorCount++;
		this.view = view;
		this.physicalURN = physicalURN;
		this.sensorURN = sensorURN;
	}

	public void replyViewSensors(Result result, String view, int number) {
		this.result = result;
		this.view = view;
		this.number = number;
	}
	
	public void replyNodeSystems(Result result, PhysicalURN physicalURN, Set<SystemURN> systemURNs) {
		this.result = result;
		this.physicalURN = physicalURN;
		this.systemURNs = systemURNs;
	}
	
	public void replyAttach(Result result) {
		this.result = result;
	}
	
	public void replyDetach(Result result) {
		this.result = result;
	}
	
	public void informViewEvent(String view, Event event) {
		this.view = view;
		this.event = event;
	}

}
